<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
	
	$(document).ready(function(){
		$("#goRegister").click(function(){
			if($("#userName").val()==""){
				alert("이름를 입력하세요");
				$("#userName").focus();
				return;
			}else if ($("#userId").val()==""){ 
				alert("아이디를 입력하세요");
				$("#userId").focus();
				return;
			}else if($("#userPass").val()==""){
				alert("패스워드를 입력하세요");
				$("#userPass").focus();
				return;
			}else if($("#passConfirm").val()==""){
				alert("패스워드를 확인하세요");
				$("#passConfirm").focus();
				return; 	
			}else if($("#userPass").val()!=$("#passConfirm").val()){
				alert("비밀번호가 같지않습니다");
			}else if($("#registerForm :checkbox[name=category]:checked").length==0){
				alert("관심요리를 선택하세요");
				return; 	
			}else if($("#registerForm :radio[name=marry]:checked").length==0){
				alert("결혼유무를 선택하세요");
				return; 	
			}else if($("#registerForm :radio[name=gender]:checked").length==0){
				alert("성별을 선택하세요");
				return; 	
			}else if($("#aniversary1_y").val()==""){
				alert("기념일 년도를 선택하세요");
			}else if($("#aniversary1_m").val()==""){
				alert("기념일 월을 선택하세요");
			}else if($("#aniversary1_d").val()==""){
				alert("기념일 일를 선택하세요");
			}else if($("#aniversary1_t").val()==""){
				alert("기념일을 선택하세요");
			}else if($("#aniversary2_y").val()==""){
				alert("기념일 년도를 선택하세요");
			}else if($("#aniversary2_m").val()==""){
				alert("기념일 월을 선택하세요");
			}else if($("#aniversary2_d").val()==""){
				alert("기념일 일를 선택하세요");
			}else if($("#aniversary2_t").val()==""){
				alert("기념일을 선택하세요");
			}

		});
	});
		
		
</script>
</head>
<body>
<!-- 회원가입 폼 -->
<center>

<form action="member.do" id="registerForm" name="registerForm">  
<input type="hidden" name="command" value="m_register">
이름 : <input type="text" id="userName"><br>
아이디 : <input type="text" id="userId">
<input type="button" value="아이디 중복검사" id="idCheck"> <span id="checkId"></span><br>
패스워드 : <input type="password" id="userPass"> 
비밀번호확인 <input type="password" id="passConfirm"><br>
<font size="2pt" color="red">(ID랑 비밀번호는 문자와 숫자를 조랍하여 2~12 자리로 만들어 주세요)</font>
<hr>
<font>추가사항</font>
<br>
<font>관심요리</font><br>
<input type="checkbox" value="한식" name="category">한식
<input type="checkbox" value="일식" name="category">일식
<input type="checkbox" value="중식" name="category">중식
<input type="checkbox" value="양식" name="category">양식<br>
<font>결혼유무</font><br>
<input type="radio" value="미혼" name="marry">미혼
<input type="radio" value="기혼" name="marry">기혼<br>
<font>성별</font><br>
<input type="radio" name="gender" value="남">남
<input type="radio" name="gender" value="여">여<br>
<font>기념일</font><br>
<select id="aniversary1_y">
		<option value="">--</option>
	<c:forEach begin="1950" end="2013" var="year">
		<option value="${year}">${year}</option>
	</c:forEach>
</select>
<select id="aniversary1_m">
		<option value="">--</option>
	<c:forEach begin="1" end="12" var="month">
		<option value="${month }">${month}</option>
	</c:forEach>
</select>
<select id="aniversary1_d">
		<option value="">--</option>
	<c:forEach begin="1" end="31" var="day">
		<option value="${day }">${day}</option>
	</c:forEach>
</select>
<select id="aniversary1_t">
		<option value="">--</option>
	<option value="생일">생일</option>	
	<option value="기념일">기념일</option>	
</select><br>

<select id="aniversary2_y">
		<option value="">--</option>
	<c:forEach begin="1950" end="2013" var="year">
		<option value="${year }">${year}</option>
	</c:forEach>
</select>
<select id="aniversary2_m">
		<option value="">--</option>
	<c:forEach begin="1" end="12" var="month">
		<option value="${month }">${month}</option>
	</c:forEach>
</select>
<select id="aniversary2_d">
		<option value="">--</option>
	<c:forEach begin="1" end="31" var="day">
		<option value="${day }">${day}</option>
	</c:forEach>
</select>
<select id="aniversary2_t">
		<option value="">--</option>
	<option value="생일">생일</option>	
	<option value="기념일">기념일</option>	
</select><br><br>
<input type="button" value="가입하기" id="goRegister">
<input type="button" value="가입취소">
</form>
</center>
</body>
</html>